﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using QLNhaSach.GUI.NhanVienQuanLySach;

namespace QLNhaSach.GUI.NhanVienKeToan
{
    public partial class NVKeToan : Form
    {
        public int maketoan;
        public NVKeToan()
        {
            InitializeComponent();
        }

        private void CloseAllChildForm()
        {
            Form[] frm = this.MdiChildren;
            for (int i = 0; i < frm.Length; i++)
            {
                frm[i].Close();
            }
        }
        private void buttonX1_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            DangXuat fmDangXuat = new DangXuat();
            fmDangXuat.MdiParent = this;
            fmDangXuat.Show();
        }

        private void btnTTCaNhan_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            ThongTinCaNhan frm_TTCaNhan = new ThongTinCaNhan();
            frm_TTCaNhan.manvChilder = maketoan;
            frm_TTCaNhan.MdiParent = this;
            frm_TTCaNhan.Show();
        }

        private void btnLapBaoCao_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            LapBaoCaoCN frm_LapBaoCaoCN = new LapBaoCaoCN();
            frm_LapBaoCaoCN.nv.MaNV = maketoan;
            frm_LapBaoCaoCN.MdiParent = this;
            frm_LapBaoCaoCN.Show();
        }

        private void btnXuatPhieu_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            XuatPhieuThu frm_XuatPhieuThu = new XuatPhieuThu();
            frm_XuatPhieuThu.nv.MaNV = maketoan;
            frm_XuatPhieuThu.MdiParent = this;
            frm_XuatPhieuThu.Show();
        }

        private void NVKeToan_Load(object sender, EventArgs e)
        {
            btnTTCaNhan_Click(sender, e);
        }

       
        private void buttonX1_Click_1(object sender, EventArgs e)
        {
            CloseAllChildForm();
            Xem_Hóa_Đơn_Khách_Hàng frm_XemHDKH = new Xem_Hóa_Đơn_Khách_Hàng();
            frm_XemHDKH.MdiParent = this;
            frm_XemHDKH.Show();

            
        }

        private void btnDangXuat_Click_1(object sender, EventArgs e)
        {
            CloseAllChildForm();
            DangXuat fmDangXuat = new DangXuat();
            fmDangXuat.maNV = maketoan;
            fmDangXuat.MdiParent = this;
            fmDangXuat.Show();

        }

        private void buttonX2_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            Xem_Hóa_Đơn_Một_Khách_Hàng fmXemHD1KH = new Xem_Hóa_Đơn_Một_Khách_Hàng();
            fmXemHD1KH.MdiParent = this;
            fmXemHD1KH.Show();
        }
    }
}